package com.more.offer.algorithm.sort.sort_02;

/**
 * Date: 2020-03-15 23:28
 * Author: pinoc
 * Desc: 冒泡排序
 */
public class BubbleSort {
	public static void bubbleSort(int[] array) {
		for (int k = array.length - 1; k > 0; k--) {
			for (int i = 0; i < k; i++) {
				if (array[i] > array[i + 1]) {
					int temp = array[i];
					array[i] = array[i + 1];
					array[i + 1] = temp;
				}
			}
		}
	}
}
